<div class="accountbinding">
    <h4>邮箱绑定</h4>
    <hr>
    <div class="login">
        <form class="find-box p-50 center-block" [formGroup]="emailBindForm" (ngSubmit)="emailBind()">
            <div class="clearfix find-row" *ngIf="Email">
                <div class="w-100 text-right pull-left"><small>已绑定邮箱：</small></div>
                <div class="pull-left po-r form-group">
                  <small>{{Email.substring(0,2)}}****{{Email.substring(Email.indexOf('@') - 2, Email.length)}}</small>
                </div>
            </div>
            <div class="clearfix find-row">
                <div class="w-100 text-right pull-left"><small>邮箱：</small></div>
                <div class="pull-left po-r form-group" [class.has-error]="((emailBindForm.hasError('email','Email') || emailBindForm.hasError('required','Email')) && emailBindForm.get('Email').touched) || error">
                    <input type="text" class="form-control" id="exampleInputPassword1" placeholder="输入您要绑定的邮箱" formControlName="Email">
                    <em [hidden]="emailBindForm.hasError('required','Email')" class="form-group-del" (click)="clear('Email')"></em>
                </div>
                <div class="login-tips" *ngIf="emailBindForm.hasError('required','Email') && emailBindForm.get('Email').touched">
                    <em class="login-tips-warn"></em> 请输入您要绑定的邮箱
                </div>
                <div class="login-tips" *ngIf="!emailBindForm.hasError('required','Email') && emailBindForm.hasError('email','Email') && emailBindForm.get('Email').touched">
                    <em class="login-tips-warn"></em> 邮箱格式不正确
                </div>
                <div class="login-tips" *ngIf="error">
                  <em class="login-tips-warn"></em> {{error}}
                </div>
            </div>
            <div class="find-row clearfix">
                <div class="w-100 pull-left">&nbsp;</div>
                <div class="form-group pull-left">
                    <button *ngIf="!loading" type="submit" class="btn form-control" [disabled]="!emailBindForm.valid || error">下一步</button>
                    <button *ngIf="loading" type="submit" class="btn form-control" disabled>下一步...</button>
                </div>
            </div>
        </form>
    </div>
</div>
